package eclipse.lib.scripting;
import java.io.*;
import eclipse.server.*;
import eclipse.util.*;
import eclipse.util.io.*;
public class SadScript 
{
	public InputStream getERL(String eString)
	{
		return new ERL(eString).openStream();
	}
	public String getVar(String file, String section, String key)
	{
		String var;
		PropertyFile pFile = new PropertyFile(new ERL(file).openStream());
		var = pFile.readProperty(section, key);
		pFile.closeProperty();
		return var;
	}
	public void putVar(String file, String section, String key, String value)
	{
		PropertyFile pFile = new PropertyFile(new ERL(file).openStream());
		pFile.writeProperty(value, section, key);
		pFile.closeProperty();
	}
	public void sendMsg(int index, String msg)
	{
		Database.client[index].sendMsg(msg);
	}
	public void disconnect(int index)
	{
		Database.client[index].close();
		Database.client[index] = null;
	}
}
